package com.qf.wangqing.sportsnews.activity;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.qf.wangqing.sportsnews.R;
import com.qf.wangqing.sportsnews.adapter.FragmentCompetitionAdapter;
import com.qf.wangqing.sportsnews.databinding.ActivityCommunityBinding;

public class CommunityActivity extends AppCompatActivity implements View.OnClickListener {
    private ActivityCommunityBinding binding;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//        setContentView(R.layout.activity_community);
        binding = DataBindingUtil.setContentView(this, R.layout.activity_community);
        initView();
    }

    private void initView() {

        FragmentCompetitionAdapter adapter = new FragmentCompetitionAdapter(getSupportFragmentManager());
        binding.viewpagerCommunity.setAdapter(adapter);
        binding.backCommunity.setOnClickListener(this);
        binding.tabCommunity.setupWithViewPager(binding.viewpagerCommunity);
    }

    @Override
    public void onClick(View view) {
        finish();
    }
}
